<!DOCTYPE html>
<html>

    <head>
        <meta charset="utf-8" />
        <title>司机信息</title>
        <link rel="stylesheet" href="__PUBLIC__/Leader/css/bootstrap.css">
        <link rel="stylesheet" type="text/css" href="__PUBLIC__/Leader/css/index.css" />
        <style type="text/css">
            .order-list a {
                position: relative;
            }
            .order-list span {
                float: right;
                margin-right: 20px;
            }
            .pagination ul {
                display: inline-block;
                margin-left: 0;
                margin-bottom: 0;
                -webkit-border-radius: 3px;
                -moz-border-radius: 3px;
                border-radius: 3px;
                -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
                -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
                box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            }
            .pagination ul > li {
                display: inline;
            }
            .pagination ul > li > a, .pagination ul > li > span {
                float: left;
                padding: 0 14px;
                line-height: 38px;
                text-decoration: none;
                background-color: #ffffff;
                border: 1px solid #dddddd;
                border-left-width: 0;
            }
        </style>
    </head>
    <body>
        <include file="Index/head"/>
        <div class="wrapper main-wrapper wrapper-content ">
            <div class="page-menubar">
                <div class="menu-header">用户管理</div>
                <ul class="order-list">
                    <li>
                        <a href="{:U('User/userinfo')}">用户信息</a>
                    </li>
                    <li>
                        <a href="{:U('User/sijiinfo')}">司机信息</a>
                    </li>
                    
                    <li class="active">
                        <a href="{:U('User/fankui_list')}">用户反馈</a>
                    </li>
                </ul>
            </div>
            <!--主要内容-->
            <div class="page-content" style="display: block;">
                <!--内容标题-->
                <!-- <div class="page-heading" style="position:relative;">
                    <h2>司机列表</h2>
                     <a  href="{:U('User/addsiji')}" class="btn btn-primary" style="position:absolute;right: 0;top: 10px;">添加司机</a>
                </div> -->
                
                <div class="panel panel-default" style="margin-top: 20px;">
                    <div class="panel-body">
                        <table class="table table-hover table-responsive">
                            <thead>
                                <tr>
                                    <th>#</th>
                                    <th>姓名</th>
                                    <th>电话</th>
                                    <th>留言内容</th>
                                    <th style="min-width: 64px;">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            <volist name="list" id="vo">
                                <tr>
                                    <th>{$vo.id}</th>
                                    <td>{$vo.0.nickname}</td>
                                    <td>{$vo.0.dianhua}</td>

                                    <Td>
                                        <a href="__CONTROLLER__/sijixg/id/{$vo.id}"><i class="glyphicon glyphicon-pencil"></i></a>
                                        <a onclick="return confirm('正在删除用户，请确认')"href="__CONTROLLER__/delsj/id/{$vo.id}"><i class="glyphicon glyphicon-remove-sign"></i></a>
                                    </td>
                                </tr>

                            </volist>

                            </tbody>
                        </table>
                    </div>
                    {$page}
                </div>
            </div>
        </div>
        <!--模态框-->
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h4 class="modal-title" id="myModalLabel">修改人员信息</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal" role="form">
                            <div class="form-group">
                                <label class="col-sm-2 control-label" for="name">姓名</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="name" placeholder="请输入姓名">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label" for="name">手机号</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="tel" placeholder="请输入手机号">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label" for="name">收货地址</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="address" placeholder="请输入收货地址">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label" for="name">标记</label>
                                <div class="col-sm-5">
                                    <a  class="btn btn-success" id="kefu" data-qx="1">标记为客服</a>
                                </div>
                                <div class="col-sm-5">
                                    <a  class="btn btn-info" id="ps" data-qx="2">标记为派送员</a>
                                </div>
                            </div>
                        </form>

                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary " id="tjbtn">确认修改</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div>
    </body>
    <script src="__PUBLIC__/Leader/js/jquery.js" type="text/javascript" charset="utf-8"></script>
    <script src="__PUBLIC__/Leader/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
    <script>
                 $(function () {
//            function list(){
//                var html="";
//                $.ajax({
//                    url:"",
//                    data:{
//                      
//                    },
//                    type:"get",
//                    success:function(data){
//                        for(var i=0;i<data.length;i++){
//                            html+='<tr>'              
//                                +    '<td>'+data[i].id+'</td>'
//                                +    '<td><img src="{$vo['headimg']}" alt="" style="width: 40px;height: 40px;" /></td>
//                                +    '<td>'+data[i].nickname+'</td>'
//                                +    '<td class="name">'+data[i].name+'</td>'
//                                +    '<td class="tel">'+data[i].tel+'</td>'
//                                +    '<td class="address">'+data[i].address+'</td>'
//                                +    '<td>'+data[i].yue+'</td>'
//                                +    '<td>'+data[i].addtime+'</td>
//                                +    '<td class="changer porint pad10" data-id="'+data[i].id+'"><a href="javascript:;">修改</a></td>'
//                                +'</tr>'
//                        }
//                        $("#trcontent").html(html);
//                  },
//              })  
//            };
//            list();
                     function setuser(id, qx) {
                         $.ajax({
                             url: "{:U('User/userbj')}",
                             data: {
                                 id: id,
                                 qx: qx,
                             },
                             type: "post",
                             success: function (data) {
                                 if (data == 0) {
                                     alert("标记成功");
                                     window.location.reload();
                                     return false;
                                 } else if (data == 1) {
                                     alert("标记失败");
                                     return false;
                                 }
                             }
                         })
                     }
                     ;
                     $("#kefu").click(function () {
                         var id = $(this).attr("data-id");
                         var qx = $(this).attr("data-qx");
                         setuser(id, qx)
                     });
                     $("#ps").click(function () {
                         var id = $(this).attr("data-id");
                         var qx = $(this).attr("data-qx");
                         setuser(id, qx)
                     });
                     $(".changer").click(function () {
                         var id = $(this).attr("data-id");
                         var name = $(this).siblings('.name').text();
                         var tel = $(this).siblings('.tel').text();
                         var address = $(this).siblings('.address').text();
                         console.log(name);
                         console.log(tel);
                         console.log(address);
                         $("#name").val(name);
                         $("#tel").val(tel);
                         $("#address").val(address);
                         $("#tjbtn").attr("data-id", id);
                         $("#kefu").attr("data-id", id);
                         $("#ps").attr("data-id", id);
                         $("#myModal").modal('show');
                     });
                     $("#tjbtn").click(function () {
                         var id = $(this).attr("data-id");
                         var name = $("#name").val();
                         ;
                         var tel = $("#tel").val();
                         var address = $("#address").val();
                         if (name == "") {
                             alert("用户名不能为空");
                             return false;
                         } else if (tel == "") {
                             alert("手机号不能为空");
                             return false;
                         } else if (address == "") {
                             alert("地址不能为空");
                             return false;
                         }
                         $.ajax({
                             url: "{:U('User/userxg')}",
                             data: {
                                 id: id,
                                 name: name,
                                 tel: tel,
                                 address: address
                             },
                             type: "post",
                             success: function (data) {
                                 if (data == 0) {
                                     alert("修改成功");
                                     window.location.reload();
                                     return false;
                                 } else if (data == 1) {
                                     alert("修改失败");
                                     return false;
                                 }
                             }
                         })
                     });
                 })
    </script>
</html>